import { SWITCH_TAB } from '../constants'

const INITIAL_STATE = {
  tabPageIndex: 0
}

export default function tab_page(state = INITIAL_STATE, action) {
  switch (action.type) {
    case SWITCH_TAB:
      return {
        ...state,
        tabPageIndex: action.pageIndex
      }
    default:
      return state
  }
}
